﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using HF.WorkFlow.DataContract;
namespace HF.WCF.WFInterface
{
     [ServiceContract]
    public interface IUserService
    {
        /// <summary>
        /// 增加
        /// </summary>
        /// <param name="entity">数据实体</param>
        /// <returns>影响的记录条数</returns>
        [OperationContract]
         int Insert(UserEntity entity);
          /// <summary>
        /// 修改
        /// </summary>
        /// <param name="entity">数据实体</param>
        /// <returns>影响的记录条数</returns>
        [OperationContract]
         int Update(UserEntity entity);
        /// <summary>
        ///  是否存在该记录
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns>true/false</returns>
         [OperationContract]
         bool Exists(string userId);
         /// <summary>
        /// 删除
        /// </summary>
        /// <param name="userId">主键Id</param>
        /// <returns>影响的记录条数</returns>
        [OperationContract]
         void Delete(string userId);
        /// <summary>
        /// 获取一个数据实体
        /// </summary>
        /// <param name="userId">主键Id</param>
        /// <returns>DataTable</returns>
        [OperationContract]
         UserEntity GetUserEntity(string userId);
         /// <summary>
        /// 读取所有用户
        /// </summary>
        /// <returns>Entitys</returns> 
        [OperationContract]
         List<UserEntity> GetAllUserEntitys();
         /// <summary>
        /// 设置密码
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="password">密码</param>
        /// <returns>是否成功</returns>
         [OperationContract]
         bool SetPassword(string userId, string password);
        /// <summary>
        /// 获取用户名
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns>用户名</returns>
        [OperationContract]
         string GetUserNameById(string userId);
        /// <summary>
        /// 用户验证
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="password">密码</param>
        /// <returns>是否通过</returns>
        [OperationContract]
         bool LoginCheck(string userId, string password);
         /// <summary>
        /// 取得用户列表,模糊查询
        /// </summary>
        /// <param name="userId">用户帐号</param>
        /// <returns>Entitys</returns>
        [OperationContract]
         List<UserEntity> GetUserEntiysLikeId(string userId);
        /// <summary>
        /// 取得用户信息,模糊查询
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns>Entitys</returns>
        [OperationContract]
         List<UserEntity> GetUserEntiysLikeName(string userName);
    }
}
